<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>图片添加</title>

    <link rel="shortcut icon" href="__PUB__/favicon.ico"> 
    <link href="__CSS__/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__CSS__/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__CSS__/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__CSS__/animate.min.css" rel="stylesheet">
    <link href="__CSS__/style.min862f.css?v=4.1.0" rel="stylesheet">
	<script src="__JS__/jquery.min.js?v=2.1.4"></script>
    <script src="__JS__/bootstrap.min.js?v=3.3.6"></script>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="ibox-title">
	       <h5>图片添加</h5>
	       <div class="ibox-tools">
	       </div>
        </div>
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
 
                    <div class="ibox-content">
                        <form method="post" class="form-horizontal" action ="{:U('Picture/ad')}" enctype = "multipart/form-data">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">图片名称</label>

                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name ="name">
                                </div>
                            </div>
                             <div class="form-group">
                                <label class="col-sm-2 control-label">图片标签</label>

                                <div class="col-sm-10">
                                    <input type="text" class="form-control" name ="tags">
                                </div>
                            </div>
                            
                     
                            <div class="form-group">
                                <label class="col-sm-2 control-label">配图</label>

								<input id="lefile" type="file" style="display:none;"name ="url"> 
                                <div class="col-sm-10">
                                    <div class="input-append">  
									    <input id="photoCover" type="text" class="form-control" style="width:300px;display:inline-block;">  
									    <a class="btn btn-sm btn-primary" onclick="$('#lefile').click();">上传图片</a>  
									</div>
                                </div>
                            </div>

                          	<div class="form-group">
                                <label class="col-sm-2 control-label">状态</label>

                                <div class="col-sm-10">
                                    <div class="radio">
                                        <label>
                                            <input type="radio" style="margin-top: 2px;"checked="" value="1" id="optionsRadios1" name="state">显示
                                        </label>
                                        <label>
                                            <input type="radio" style="margin-top: 2px;"value="0" id="optionsRadios2" name="state">不显示
                                        </label>
                                    </div>
                                </div>
                            </div> 
                            <div class="form-group">
                                <label class="col-sm-2 control-label">分类</label>
                                
                                <div class="col-sm-10">
                                    <select name="classify" class="form-control"style="width:300px;" id="classify">
                                    	<option value="0">请选择</option>
	                                    <foreach name="picture_cat" item="vo">
	                                    	<if condition="$vo.level eq 0">
											<option value="{$vo.id}">{$vo.name}</option>
											<else/>
											<option value="{$vo.id}">|--{$vo.name}</option>
											</if>
										</foreach>
					    		   </select>
                                </div>
                            </div>

                            <input type="submit" value="确定添加" class ="btn btn-sm btn-primary"style ="margin: 0 0 0 400px;"/>
                       </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

</body>

    <script>
        $('#lefile').change(function() {  
        	$('#photoCover').val($(this).val());  
        });  
        $('#lefile2').change(function() {  
        	$('#code').val($(this).val());  
        });
        
        $("#classify").change(function(){
      	  if(this.value=="1"){
				$('#index_1').show();
				$('#index_2').show();
				$('#index_3').show(); 
      	  }else{
				$('#index_1').hide();
				$('#index_2').hide();
				$('#index_3').hide(); 
      	 }
        });
        	
        
    </script>
</html>
